Optimal. Leaf size=209 \[ \frac{\sqrt{\pi } \exp \left (-(-\log (f)+i) \left (a-\frac{b^2 (-\log (f)+i)}{-4 c \log (f)+4 i e}\right )\right ) \text{Erf}\left (\frac{b (-\log (f)+i)+2 x (-c \log (f)+i e)}{2 \sqrt{-c \log (f)+i e}}\right )}{4 \sqrt{-c \log (f)+i e}}+\frac{\sqrt{\pi } \exp \left ((\log (f)+i) \left (a-\frac{b^2 (\log (f)+i)}{4 c \log (f)+4 i e}\right )\right ) \text{Erfi}\left (\frac{b (\log (f)+i)+2 x (c \log (f)+i e)}{2 \sqrt{c \log (f)+i e}}\right )}{4 \sqrt{c \log (f)+i e}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.481805, antiderivative size = 209, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 5, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.208, Rules used = {4473, 2287, 2234, 2205, 2204} \[ \frac{\sqrt{\pi } \exp \left (-(-\log (f)+i) \left (a-\frac{b^2 (-\log (f)+i)}{-4 c \log (f)+4 i e}\right )\right ) \text{Erf}\left (\frac{b (-\log (f)+i)+2 x (-c \log (f)+i e)}{2 \sqrt{-c \log (f)+i e}}\right )}{4 \sqrt{-c \log (f)+i e}}+\frac{\sqrt{\pi } \exp \left ((\log (f)+i) \left (a-\frac{b^2 (\log (f)+i)}{4 c \log (f)+4 i e}\right )\right ) \text{Erfi}\left (\frac{b (\log (f)+i)+2 x (c \log (f)+i e)}{2 \sqrt{c \log (f)+i e}}\right )}{4 \sqrt{c \log (f)+i e}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4473
Rule 2287
Rule 2234
Rule 2205
Rule 2204
Rubi steps
\begin{align*} \int f^{a+b x+c x^2} \cos \left (a+b x+e x^2\right ) \, dx &=\int \left (\frac{1}{2} e^{-i a-i b x-i e x^2} f^{a+b x+c x^2}+\frac{1}{2} e^{i a+i b x+i e x^2} f^{a+b x+c x^2}\right ) \, dx\\ &=\frac{1}{2} \int e^{-i a-i b x-i e x^2} f^{a+b x+c x^2} \, dx+\frac{1}{2} \int e^{i a+i b x+i e x^2} f^{a+b x+c x^2} \, dx\\ &=\frac{1}{2} \int \exp \left (-a (i-\log (f))-b x (i-\log (f))-x^2 (i e-c \log (f))\right ) \, dx+\frac{1}{2} \int \exp \left (a (i+\log (f))+b x (i+\log (f))+x^2 (i e+c \log (f))\right ) \, dx\\ &=\frac{1}{2} \exp \left (-(i-\log (f)) \left (a-\frac{b^2 (i-\log (f))}{4 i e-4 c \log (f)}\right )\right ) \int \exp \left (\frac{(-b (i-\log (f))+2 x (-i e+c \log (f)))^2}{4 (-i e+c \log (f))}\right ) \, dx+\frac{1}{2} \exp \left ((i+\log (f)) \left (a-\frac{b^2 (i+\log (f))}{4 i e+4 c \log (f)}\right )\right ) \int \exp \left (\frac{(b (i+\log (f))+2 x (i e+c \log (f)))^2}{4 (i e+c \log (f))}\right ) \, dx\\ &=\frac{\exp \left (-(i-\log (f)) \left (a-\frac{b^2 (i-\log (f))}{4 i e-4 c \log (f)}\right )\right ) \sqrt{\pi } \text{erf}\left (\frac{b (i-\log (f))+2 x (i e-c \log (f))}{2 \sqrt{i e-c \log (f)}}\right )}{4 \sqrt{i e-c \log (f)}}+\frac{\exp \left ((i+\log (f)) \left (a-\frac{b^2 (i+\log (f))}{4 i e+4 c \log (f)}\right )\right ) \sqrt{\pi } \text{erfi}\left (\frac{b (i+\log (f))+2 x (i e+c \log (f))}{2 \sqrt{i e+c \log (f)}}\right )}{4 \sqrt{i e+c \log (f)}}\\ \end{align*}
Mathematica [A] time = 1.79565, size = 325, normalized size = 1.56 \[ -\frac{i \sqrt{\pi } e^{-\frac{b^2 c \log ^3(f)}{2 \left (c^2 \log ^2(f)+e^2\right )}} f^{a-\frac{b^2}{2 (e-i c \log (f))}} \left ((\cos (a)+i \sin (a)) (e+i c \log (f)) \sqrt{c \log (f)+i e} \exp \left (\frac{1}{4} b^2 \left (\frac{\log ^2(f)}{c \log (f)-i e}+\frac{1}{c \log (f)+i e}\right )\right ) \text{Erfi}\left (\frac{\log (f) (b+2 c x)+i (b+2 e x)}{2 \sqrt{c \log (f)+i e}}\right )-(\cos (a)-i \sin (a)) (e-i c \log (f)) \sqrt{c \log (f)-i e} f^{\frac{i b^2 c \log (f)}{c^2 \log ^2(f)+e^2}} \exp \left (\frac{1}{4} b^2 \left (\frac{\log ^2(f)}{c \log (f)+i e}+\frac{1}{c \log (f)-i e}\right )\right ) \text{Erfi}\left (\frac{\log (f) (b+2 c x)-i (b+2 e x)}{2 \sqrt{c \log (f)-i e}}\right )\right )}{4 \left (c^2 \log ^2(f)+e^2\right )} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.099, size = 216, normalized size = 1. \begin{align*} -{\frac{{f}^{a}\sqrt{\pi }}{4}{{\rm e}^{-{\frac{ \left ( \ln \left ( f \right ) \right ) ^{2}{b}^{2}+4\,i\ln \left ( f \right ) ac-2\,i\ln \left ( f \right ){b}^{2}+4\,ae-{b}^{2}}{4\,c\ln \left ( f \right ) -4\,ie}}}}{\it Erf} \left ( -\sqrt{ie-c\ln \left ( f \right ) }x+{\frac{b\ln \left ( f \right ) -ib}{2}{\frac{1}{\sqrt{ie-c\ln \left ( f \right ) }}}} \right ){\frac{1}{\sqrt{ie-c\ln \left ( f \right ) }}}}-{\frac{{f}^{a}\sqrt{\pi }}{4}{{\rm e}^{-{\frac{ \left ( \ln \left ( f \right ) \right ) ^{2}{b}^{2}-4\,i\ln \left ( f \right ) ac+2\,i\ln \left ( f \right ){b}^{2}+4\,ae-{b}^{2}}{4\,ie+4\,c\ln \left ( f \right ) }}}}{\it Erf} \left ( -\sqrt{-c\ln \left ( f \right ) -ie}x+{\frac{b\ln \left ( f \right ) +ib}{2}{\frac{1}{\sqrt{-c\ln \left ( f \right ) -ie}}}} \right ){\frac{1}{\sqrt{-c\ln \left ( f \right ) -ie}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: IndexError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 0.55359, size = 938, normalized size = 4.49 \begin{align*} -\frac{\sqrt{\pi }{\left (c \log \left (f\right ) - i \, e\right )} \sqrt{-c \log \left (f\right ) - i \, e} \operatorname{erf}\left (\frac{{\left (2 \, e^{2} x +{\left (2 \, c^{2} x + b c\right )} \log \left (f\right )^{2} + b e +{\left (i \, b c - i \, b e\right )} \log \left (f\right )\right )} \sqrt{-c \log \left (f\right ) - i \, e}}{2 \,{\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right ) e^{\left (-\frac{{\left (b^{2} c - 4 \, a c^{2}\right )} \log \left (f\right )^{3} + i \, b^{2} e - 4 i \, a e^{2} -{\left (-2 i \, b^{2} c + 4 i \, a c^{2} + i \, b^{2} e\right )} \log \left (f\right )^{2} -{\left (b^{2} c - 2 \, b^{2} e + 4 \, a e^{2}\right )} \log \left (f\right )}{4 \,{\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right )} + \sqrt{\pi }{\left (c \log \left (f\right ) + i \, e\right )} \sqrt{-c \log \left (f\right ) + i \, e} \operatorname{erf}\left (\frac{{\left (2 \, e^{2} x +{\left (2 \, c^{2} x + b c\right )} \log \left (f\right )^{2} + b e +{\left (-i \, b c + i \, b e\right )} \log \left (f\right )\right )} \sqrt{-c \log \left (f\right ) + i \, e}}{2 \,{\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right ) e^{\left (-\frac{{\left (b^{2} c - 4 \, a c^{2}\right )} \log \left (f\right )^{3} - i \, b^{2} e + 4 i \, a e^{2} -{\left (2 i \, b^{2} c - 4 i \, a c^{2} - i \, b^{2} e\right )} \log \left (f\right )^{2} -{\left (b^{2} c - 2 \, b^{2} e + 4 \, a e^{2}\right )} \log \left (f\right )}{4 \,{\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right )}}{4 \,{\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int f^{a + b x + c x^{2}} \cos{\left (a + b x + e x^{2} \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int f^{c x^{2} + b x + a} \cos \left (e x^{2} + b x + a\right )\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]